\(\int (a+b \tan (c+d x)) \, dx\) [417]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 17 \[ \int (a+b \tan (c+d x)) \, dx=a x-\frac {b \log (\cos (c+d x))}{d} \]

[Out]

a*x-b*ln(cos(d*x+c))/d

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3556} \[ \int (a+b \tan (c+d x)) \, dx=a x-\frac {b \log (\cos (c+d x))}{d} \]

[In]

Int[a + b*Tan[c + d*x],x]

[Out]

a*x - (b*Log[Cos[c + d*x]])/d

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a x+b \int \tan (c+d x) \, dx \\ & = a x-\frac {b \log (\cos (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int (a+b \tan (c+d x)) \, dx=a x-\frac {b \log (\cos (c+d x))}{d} \]

[In]

Integrate[a + b*Tan[c + d*x],x]

[Out]

a*x - (b*Log[Cos[c + d*x]])/d

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.29

method result size
default \(a x +\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(22\)
norman \(a x +\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(22\)
parallelrisch \(a x +\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(22\)
parts \(a x +\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(22\)
derivativedivides \(\frac {\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+a \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(29\)
risch \(i b x +\frac {2 i b c}{d}+a x -\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(36\)

[In]

int(a+b*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

a*x+1/2*b/d*ln(1+tan(d*x+c)^2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.59 \[ \int (a+b \tan (c+d x)) \, dx=\frac {2 \, a d x - b \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]

[In]

integrate(a+b*tan(d*x+c),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x - b*log(1/(tan(d*x + c)^2 + 1)))/d

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.41 \[ \int (a+b \tan (c+d x)) \, dx=a x + b \left (\begin {cases} \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text {for}\: d \neq 0 \\x \tan {\left (c \right )} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate(a+b*tan(d*x+c),x)

[Out]

a*x + b*Piecewise((log(tan(c + d*x)**2 + 1)/(2*d), Ne(d, 0)), (x*tan(c), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.94 \[ \int (a+b \tan (c+d x)) \, dx=a x + \frac {b \log \left (\sec \left (d x + c\right )\right )}{d} \]

[In]

integrate(a+b*tan(d*x+c),x, algorithm="maxima")

[Out]

a*x + b*log(sec(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.06 \[ \int (a+b \tan (c+d x)) \, dx=a x - \frac {b \log \left ({\left | \cos \left (d x + c\right ) \right |}\right )}{d} \]

[In]

integrate(a+b*tan(d*x+c),x, algorithm="giac")

[Out]

a*x - b*log(abs(cos(d*x + c)))/d

Mupad [B] (verification not implemented)

Time = 4.76 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.24 \[ \int (a+b \tan (c+d x)) \, dx=a\,x+\frac {b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d} \]

[In]

int(a + b*tan(c + d*x),x)

[Out]

a*x + (b*log(tan(c + d*x)^2 + 1))/(2*d)